package com.friendc.Controller;

import com.alibaba.fastjson.JSONObject;
import com.friendc.Service.UserService;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class DelFriendCController extends HttpServlet{
	UserService ju = new UserService();
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	
	public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//前端 发送请求 防止乱码
		req.setCharacterEncoding("utf-8");
		String id = req.getParameter("id");
		ju.delFriendC(id);
		boolean flag = true;
		String msg = JSONObject.toJSONString(flag);
		resp.getWriter().write(msg);
	}
}
